package com.woniu.controller;

import com.woniu.entity.KillBook;
import com.woniu.entity.TakeawayOrder;
import com.woniu.service.SecKillService;
import com.woniu.service.TakeawayService;
import com.woniu.util.ResponseData;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/takeaway")
@AllArgsConstructor
public class TakeawayOrderController {
    private TakeawayService takeawayService;

    @GetMapping("/queryTakeOrder")
    public ResponseData<?> queryTakeOrder(){
        return ResponseData.ok(takeawayService.queryAll());
    }

    @PostMapping("/queryTakeOrderBy")
    public ResponseData<?> queryTakeOrderBy(@RequestBody TakeawayOrder takeawayOrder){
        return ResponseData.ok(takeawayService.queryTakeOrderBy(takeawayOrder));
    }

}
